package com.fly.studio.script.mvel;

import org.mvel2.MVEL;

import java.util.Map;

/**
 * Mvel Script
 *
 * @author Mr.Fu
 * @date 2023/1/1 下午3:08
 */
public class MvelScript {

    private MvelScript() {
    }

    /**
     * execute expression
     *
     * @param expression expression
     * @return result
     */
    public static Object execute(String expression) {
        return MVEL.eval(expression);
    }

    /**
     * execute expression mapping
     *
     * @param expression expression
     * @param mapping    mapping
     * @return result
     */
    public static Object execute(String expression, Map<String, Object> mapping) {
        return MVEL.eval(expression, mapping);
    }
}
